
/**
 *
 */
package com.serviceprovider.business.module.admin.bonus.services.dao.interfaces;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.admin.bonus.model.Bonus;
import com.serviceprovider.business.module.admin.bonus.model.BonusCalculationResult;
import com.serviceprovider.business.module.admin.bonus.model.BonusPayment;
import com.serviceprovider.business.module.admin.bonus.model.PayBonusForm;
import com.serviceprovider.business.module.common.Page;
import com.serviceprovider.business.module.user.model.impl.User;

//~--- JDK imports ------------------------------------------------------------

import java.util.List;
import java.util.Map;

/**
 * @author mrduongnv@gmail.com
 *
 */
public interface IBonusService {
    Bonus getBonusById(int id);

    List<Bonus> findAll();

    Page<Bonus> findAll(int pageNo, int recordSize, String sortColumn, String sortOrder);

    Map getTables();

    List<Bonus> findBonusesByUser(int userId);

    void insertBonus(Bonus bonus, double[] desiredAmounts, double[] flatRates, double[] percentRates, int[] roleIds,
                     int[] userIds);

    void updateBonus(Bonus bonus, double[] desiredAmounts, double[] flatRates, double[] percentRates, int[] roleIds,
                     int[] userIds);

    void deleteBonusesById(int[] idList);

    BonusCalculationResult computeBonus(Bonus b, int user_id);

    List<BonusPayment> findBonusPaymentsByBonusId(int bonusId);

    List<BonusPayment> findBonusPaymentsByBonusId(int bonusId, int userId);

    BonusPayment getBonusPayment(int bonusPaymentId);

    public void pay(int bonusId, int userId, double payAmount, int payAs);

    public List<User> getUsersByBonusId(int bonusId);

    public void createPaymentSchedule(PayBonusForm f);

    public void executeScheduledPayments();
}



